/*
 * @Author: nexox 2685853507@qq.com
 * @Date: 2024-11-26 10:22:28
 * @LastEditors: nexox 2685853507@qq.com
 * @LastEditTime: 2024-11-26 10:30:36
 * @FilePath: \pytorch_workplace\matrix\w12\k2.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <stdio.h>
#include <string.h>

int inRange(char c, char c1, char c2) { return c >= c1 && c <= c2; }

int main() {
    char s[300];
    scanf("%[^\n]", s);
    int len = strlen(s);
    int p1 = 0, p2 = len - 1;
    while (p1 < p2) {
        while (!inRange(s[p1], 'a', 'z') && !inRange(s[p1], 'A', 'Z') && p1 < len)
            p1++;
        while (!inRange(s[p2], 'a', 'z') && !inRange(s[p2], 'A', 'Z') && p2 >= 0)
            p2--;
        if (p1 > p2) break;
        if (inRange(s[p1], 'A', 'Z')) s[p1] = s[p1] - 'A' + 'a';
        if (inRange(s[p2], 'A', 'Z')) s[p2] = s[p2] - 'A' + 'a';
        if (s[p1] != s[p2]) {
            printf("false");
            return 0;
            break;
        }
        p1++;
        p2--;
    }
    printf("true\n");
    for (int i = 0; i < len; i++)
        if (inRange(s[i], 'a', 'z')) printf("%c", s[i]);
}